/*
== Date ==
13th April 2024

Inspiration: https://codepen.io/simeydotme/pen/QWJqRvB?editors=1100

Supabase Ticket URL: https://supabase.com/special-announcement/tickets/gambhirsharma?lw=11&platinum=true

*/
html {
  --zoom: 120;
  --green: #37996b;
  --neon: #3ecf8e;
}
:root {
  --unit: 1vmin;
  --available-screen-min: 665;
  --px: calc(var(--zoom) * (var(--unit) / var(--available-screen-min)));
  --bg: #060809;
  --logopng: url(https://res.cloudinary.com/dpphcu4gm/image/upload/v1712993492/supabase-outline-logo_u83xos.png);
  --ticket: url(https://assets.codepen.io/13471/ticket-shape.svg);
  --ar: 10/30;
  --gutter: 8%;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
}
*::after,
*::before {
  content: "";
  display: block;
  position: relative;
  box-sizing: border-box;
}
head::before,
head::after,
body::before,
body::after,
html::before,
html::after {
  content: "";
  position: absolute;
  background-repeat: no-repeat;
  box-sizing: border-box;
  filter: blur(0);
}
body {
  all: unset;
  background-color: var(--bg);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
a {
  all: unset;
}

#app {
  perspective: 1200px;
  --o: 0;
  --p: 100%;
  --h: 50%;
  --r: 0;
  transform: translate3d(0, 0, 0.1px);
}

.ticket {
  --scale: 1;
  transform: translate3d(0, 0, 0.1px) scale(var(--scale)) rotateY(var(--r));
  transform-style: preserve-3d;
  pointer-events: auto;
}

.front,
.back {
  grid-area: 1/1;
  background-color: #6e6176;
  background-image: radial-gradient(
    circle at var(--p) 50%,
    #111 10%,
    transparent 100%
  );
  background-size: 100% 220vh;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 15px;
  display: grid;
  backface-visibility: visible;
  transform: translateZ(1px);
  transform-style: preserve-3d;
  mask-image: var(--ticket);
  mask-size: cover;
  mask-repeat: no-repeat;
  height: calc(420 * var(--px));
}
.cutout {
  position: absolute;
}

.front::after,
.back::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    -70deg,
    transparent 40%,
    rgba(255, 255, 255, 0.5) 40.5%,
    transparent
  );
  background-size: 200% 200%;
  background-position: var(--p) var(--p);
  z-index: 5;
  opacity: calc(var(--o) + 0.5);
  pointer-events: none;
}

.front {
  transform: rotateY(180deg) translateZ(1px);
}
.back {
  padding: calc(20 * var(--px));
}

.holo {
  display: block;
  position: absolute;
  inset: 0;
  border-radius: 15px;
}

.holo {
  --space: 5%;
  --red: hsl(0, 100%, 50%);
  --orange: hsl(30, 100%, 50%);
  --yellow: hsl(60, 100%, 50%);
  --green: hsl(120, 100%, 50%);
  --cyan: hsl(180, 100%, 50%);
  --blue: hsl(222, 100%, 50%);
  --purple: hsl(258, 100%, 50%);
  --magenta: hsl(300, 100%, 50%);
  background-image: repeating-linear-gradient(
    -45deg,
    var(--red) 0%,
    var(--orange) calc(var(--space) * 1),
    var(--yellow) calc(var(--space) * 2),
    var(--green) calc(var(--space) * 3),
    var(--cyan) calc(var(--space) * 4),
    var(--blue) calc(var(--space) * 5),
    var(--purple) calc(var(--space) * 6),
    var(--magenta) calc(var(--space) * 7),
    var(--red) calc(var(--space) * 8)
  );
  background-size: 150vw 150vh;
  background-position: calc(var(--h)) calc(var(--h));
  background-repeat: no-repeat;
  mask-image: var(--logopng);
  mask-size: 80% 80%;
  mask-repeat: no-repeat;
  mask-position: 150% 180%;
  mix-blend-mode: plus-lighter;
  filter: brightness(0.9) contrast(0.7) saturate(2);
  opacity: var(--o);
}

.logo {
  width: 50%;
  place-self: center;
  transform: translateY(-14%);
}

.divider {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: start;
  bottom: 2%;
  left: 0;
  right: 0;
  height: 18%;
  padding: 0 var(--gutter);
  text-transform: uppercase;

  background-image: repeating-linear-gradient(
      90deg,
      #fff0 0px,
      #fff0 8px,
      var(--green) 8px,
      var(--green) 16px
    ),
    radial-gradient(ellipse at center center, #fff0 10%, transparent 50%);
  background-size: 100% 1.5px, 250% 1.5px;
  background-repeat: no-repeat;
  background-position: -4px top, var(--h) top;
  background-blend-mode: overlay;

  font-size: 16px;
  font-weight: 400;
  z-index: 2;

  div {
    display: flex;
    align-items: center;
    justify-content: left;
  }
}

.divider > div > img {
  margin-right: 10px;
  height: 40px;
}
#app {
  color: #fff;
  /* font-family: "Roboto Mono", monospace; */
  display: grid;
  grid: 1fr/1fr;
  place-content: center;
  overflow: hidden;
  padding: 50px;
  z-index: 999;
  height: 90%;
}

.ticket {
  display: grid;
  grid-area: 1/1;
  width: calc(300 * var(--px));
  height: calc(400 * var(--px));
  aspect-ratio: var(--ar);
}

@media screen and (max-width: 400px) {
  .ticket {
    --scale: 0.75;
  }
}

#id_number {
  position: absolute;
  margin: calc(40 * var(--px)) calc(20 * var(--px));
}

.data {
  position: absolute;
  top: calc(70 * var(--px));
  margin: calc(20 * var(--px));
}
.name {
  font-size: calc(30 * var(--px));
}
.githubid {
  font-size: calc(20 * var(--px));
}
h3 {
  font-size: calc(15 * var(--px));
}
